package com.xiongwei.command;

/**
 * @author XiongWei
 * @date 2024/1/28
 */
public class Client {

    public static void main(String[] args) {
        Command tvOnCommand = new TvOnCommand(new Tv());
        Command tvOffCommand = new TvOffCommand(new Tv());

        Command lightOnCommand = new LightOnCommand(new Light());
        Command lightOffCommand = new LightOffCommand(new Light());

        Controller controller = new Controller();
        controller.setCommand(1, tvOnCommand, tvOffCommand);
        controller.setCommand(2, lightOnCommand, lightOffCommand);

        controller.on(1);
        controller.off(1);

        controller.on(2);
        controller.off(2);

    }
}
